function [vp, vr] ...
    = fn_iteration2(n, vk, vF, ck, cP, cQ, ck_dH, cu_dH, Num_point)

f = @(x) fn_F2(n, x,vk,vF,ck,cP,cQ,ck_dH,cu_dH);

p_left = 0;
p_right = 1000;
vp = linspace(p_left, p_right, 100);
vr = zeros(1, length(vp));

for i = 1:length(vp)
    
    p = vp(i);
    r = f(p);
    vr(i) = r;
    
end

while 1
    
    vd = abs(vr(2:end) - vr(1:end-1));
    [~, max_region] = max(vd);
    ind_left = max_region;
    ind_right = max_region + 1;
    
    p_left = vp(ind_left);
    p_right = vp(ind_right);
    p_mid = 1/2*(p_left + p_right);
    
    new_r = f(p_mid);
    vp = [vp(1:ind_left), p_mid, vp(ind_right:end)];
    vr = [vr(1:ind_left), new_r, vr(ind_right:end)];
    
    if length(vp)>=Num_point
        break;
    end
    
end

end